<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试工具函数</title>
</head>

<body>
    <script src="util.js"></script>
    <script>
        /*
        * 测试防抖函数
        */
        function say(msg) {
            msg = msg || "大家好";
            console.log("say", msg);
        }
        debounce(say); debounce(say); debounce(say); debounce(say); debounce(say); debounce(say); debounce(say); debounce(say); debounce(say); debounce(say); debounce(say); debounce(say);
        debounce();
        /*
        * 测试节流函数
        */
        throttle(say, "测试节流函数"); throttle(say, "测试节流函数"); throttle(say, "测试节流函数"); throttle(say, "测试节流函数"); throttle(say, "测试节流函数"); throttle(say, "测试节流函数"); throttle(say, "测试节流函数");
        throttle();
    </script>
</body>

</html>